package com.cntcdt.api.service;

import java.util.List;

import com.cntcdt.api.db.model.GroupDeviceDayDivideCntModel;

public interface GroupDeviceDayDivideCntService {
	/**
	 * 按照集团id查询昨天数据
	 * 
	 * @param gourpId
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByYesterday(int gourpId, int giveBusinessIncome);

	/**
	 * 按照集团id和设备号查询昨天数据
	 * 
	 * @param gourpId
	 * @param terminal
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByYesterday(int gourpId, String terminal, int giveBusinessIncome);

	/**
	 * 按照集团id查询本月数据
	 * 
	 * @param groupUserId
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByThisMonth(int groupUserId, int giveBusinessIncome);

	/**
	 * 按照集团id和设备号查询本月数据
	 * 
	 * @param gourpId
	 * @param terminal
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByThisMonth(int gourpId, String terminal, int giveBusinessIncome);

	/**
	 * 查询在指定集团列表内的数据
	 * 
	 * @param groupUserIds
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByThisMonthNextLevel(String groupUserIds);

	/**
	 * 查询在指定集团列表内和设备的数据
	 * 
	 * @param groupUserIds
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByThisMonthNextLevel(String groupUserIds, String terminal);

	/**
	 * 根据集团id查询7天内的数据
	 * 
	 * @param groupUserId
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findByLastSevenDayData(int groupUserId, int giveBusinessIncome);

	/**
	 * 根据集团id跟设备号查询7天内数据
	 * 
	 * @param groupUserId
	 * @param terminal
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findByLastSevenDayData(int groupUserId, String terminal,
			int giveBusinessIncome);

	/**
	 * 分页查询数据
	 * 
	 * @param groupUserId
	 * @param sortTime
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findBySortTime(int groupUserId, long sortTime);

	/**
	 * 
	 * @param groupUserId
	 * @param sortTime
	 * @param giveBusinessIncome
	 * @param queryType
	 *            查询类型 1：查借电次数 2：查收益
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findBySortTimeSum(int groupUserId, long sortTime, int giveBusinessIncome,
			int dataType);

	/**
	 * 按月分查询数据
	 * 
	 * @param groupUserId
	 * @param sortTime
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findMonthDataBySortTime(int groupUserId, long sortTime,
			int giveBusinessIncome);

	/**
	 * 查询单台设备分页数据
	 * 
	 * @param groupUserId
	 * @param sortTime
	 * @param terminal
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findBySortTime(int groupUserId, long sortTime, String terminal,
			int giveBusinessIncome, int level);

	/**
	 * 按月分查询单台设备数据
	 * 
	 * @param groupUserId
	 * @param sortTime
	 * @param terminal
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findMonthDataBySortTime(int groupUserId, long sortTime, String terminal,
			int giveBusinessIncome);

	/**
	 * 查询指定日期数据
	 * 
	 * @param groupUserId
	 * @param time
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findByDateTime(int groupUserId, String time, int giveBusinessIncome);

	/**
	 * 查询当天开始算前N天的数据
	 * 
	 * @param dataNum
	 * @param terminal
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findByDataNum(int dataNum, String terminal);

	/**
	 * 更新单条数据
	 * 
	 * @param groupDeviceDayDivideCnt
	 * @return
	 */
	public boolean updateModel(GroupDeviceDayDivideCntModel groupDeviceDayDivideCnt);

	/**
	 * 删除单条数据
	 * 
	 * @param groupDeviceDayDivideCnt
	 * @return
	 */
	public boolean deleteModel(GroupDeviceDayDivideCntModel groupDeviceDayDivideCnt);

	/**
	 * 获取指定日期指定机器的数据
	 * 
	 * @param dateTime
	 * @param groupUserId
	 * @param terminal
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByDateTimeAndGroupUserId(String dateTime, int groupUserId, String terminal);

	public List<GroupDeviceDayDivideCntModel> findByDate(int groupUserId, String startDate, String endDate);

	public List<GroupDeviceDayDivideCntModel> findSingleDeviceByDate(int userId, String terminal, String starDate,
			String endDate);

	/**
	 * 按月查询数据
	 * 
	 * @param groupUserId
	 * @param sortTime
	 * @param giveBusinessIncome
	 * @param queryType
	 *            1：次数人数统计 2：收益
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findMonthDataBySortTime(int groupUserId, long sortTime,
			int giveBusinessIncome, int dataType);

	/**
	 * 
	 * @param groupUserId
	 * @param sortTime
	 * @param terminal
	 * @param giveBusinessIncome
	 * @param level
	 * @param queryType
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findBySortTime(int groupUserId, long sortTime, String terminal,
			int giveBusinessIncome, int level, int dataType);

	/**
	 * 昨天次数统计
	 * @param groupUserId
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByYesterdayCnt(int groupUserId);
	
	/**
	 * 本月统计次数
	 * @param groupUserId
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByThisMonthCnt(int groupUserId);
	
	/**
	 * 近七天的统计次数
	 * @param groupUserId
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findByLastSevenDayCntData(int groupUserId);
	
	/**
	 * 指定日期的数据
	 * @param groupUserId
	 * @param time
	 * @param giveBusinessIncome
	 * @param pageId
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findCntByDateTime(int groupUserId, String time, int giveBusinessIncome,int dataType);
	
	/**
	 * 近七天集团指定机器次数统计
	 * @param groupUserId
	 * @param terminal
	 * @return
	 */
	public List<GroupDeviceDayDivideCntModel> findByLastSevenDayCntData(int groupUserId,String terminal);
	
	/**
	 * 本月集团指定机器次数统计
	 * @param groupUserId
	 * @param terminal
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findByThisMonthCnt(int groupUserId,String terminal);
	
	/**
	 * 昨天集团指定机器次数统计
	 * @param groupUserId
	 * @param terminal
	 * @return
	 */
	public GroupDeviceDayDivideCntModel findCntByYesterday(int groupUserId, String terminal);
	
	public List<GroupDeviceDayDivideCntModel> findMonthDataBySortTime(int groupUserId,long sortTime,String terminal,int giveBusinessIncome,int dataType);
}
